<template>
  <div class="top-rated">
    <slot></slot>
    <div class="top-rated-list">
      <div class="top-rated-item" v-for="(item, i) in arr" :key="i">
        <img :src="item.img" alt="" />
        <h5 class="name">{{ item.nm }}</h5>
        <span class="score" v-if="item.mk && item.mk !== 0"
          >观众评分 {{ item.sc }}</span
        >
        <div class="wishs" v-else>
          <span class="person">{{ item.wish }}</span>
          <span class="p-suffix">人想看</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "TopMovie",
  data() {
    return {
      toparr: [],
    };
  },
  props: ["arr"],
};
</script>

<style scoped>
.top-rated {
  margin-top: 156px;
  width: auto;
  height: 4.9rem;
  margin-bottom: 20px;
  padding: 12px 15px;
  border-bottom: 10px solid #f5f5f5;
}

.top-rated-list {
  width: auto;
  overflow-x: scroll;
  overflow-y: hidden;
  height: 143px;
  display: flex;
  flex-wrap: nowrap;
}

.top-rated-list::-webkit-scrollbar {
  display: none;
}

.top-rated-item {
  width: 2.2667rem;
  height: 143.5px;
  margin-right: 10px;
  display: inline-block;
  position: relative;
}

.top-rated-item img {
  width: 2.2667rem;
  height: 115px;
}

.name {
  width: 2.2667rem;
  height: 20px;
  line-height: 20px;
  font-size: 13px;
  color: #333;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  width: 90%;
  height: 18px;
  display: inline-block;
  color: #faaf00;
  font-size: 12px;
  position: absolute;
  bottom: 30px;
  left: 4px;
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.3);
}
.wishs {
  position: absolute;
  bottom: 30px;
  color: #faaf00;
  font-size: 12px;
  font-weight: 700;
}
.score-line span:nth-child(2),
.detail-column .score-line .person {
  font-size: 15px;
  color: #faaf00;
  font-weight: 600;
}

.actor,
.show-info,
.detail-column .score-line .p-suffix {
  font-size: 13px;
  color: #666;
}
</style>